﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace ViewModel.ValueConverters
{
    public class TitleTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                bool IsLaunch = (bool)value;
                if (IsLaunch)
                {
                    return "-登录-";
                }
                else
                {
                    return "-注册-";
                }
            }

            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class ButtonTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                bool IsLaunch = (bool)value;
                if (IsLaunch)
                {
                    return "登录";
                }
                else
                {
                    return "注册";
                }
            }

            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class PanelTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                bool IsLaunch = (bool)value;
                if (IsLaunch)
                {
                    return "无账号？";
                }
                else
                {
                    return "有账号？";
                }
            }

            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class ButtonPanelTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                bool IsLaunch = (bool)value;
                if (IsLaunch)
                {
                    return "注册";
                }
                else
                {
                    return "登录";
                }
            }

            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}